import Vue from 'vue'
import Vuex from 'vuex'

import getters from './getters'
import user from './modules/user'

Vue.use(Vuex)

const store = new Vuex.Store({
    modules: {
        user
    },
    state: {
        loading: false,
        text: "加载中"
    },
    getters,
    mutations: {
        loading(state, value) {
            state.loading = value.loading;
            if (value.text) {
                state.text = value.text;
            }
        }
    },
    actions: {

    }
})

export default store